<!DOCTYPE html>
<html lang="en">

{include file='head'}

<section class="rt_wrap content mCustomScrollbar">

        <ul class="ulColumn2">
<li>
    <form action="upload" method="post" enctype="multipart/form-data">

    <span class="item_name" style="width:120px">上传头像：</span>

        <label class="uploadImg">
            <input type="file" id="pic" name="img"/>

            <span>上传头像</span>
        </label>
        <input type="button" name="btn1" value="上传">
        <input type="submit" name="btn" value="上传">
    </form>
</li>
        </ul>
</section>
</body>
</html>
<script>
    $(function () {

        $('[name=btn1]').click(function () {

            this.type = 'submit';

        });

        function success(data)
        {
            console.log(data);
            switch (data.status) {

                case -1:
                    console.log(data.path);
                    break;

                case 0:
                    console.log(data.path);
                    break;
            }

        }

    });

</script>